import React from "react";
import ProductInfo from "./components/productInfo/ProductInfo";

// 组件名称 必须大驼峰命名
// 父组件
class App extends React.Component {
  state = {
    item: {
      url: "http://gips1.baidu.com/it/u=1647344915,1746921568&fm=3028&app=3028&f=JPEG&fmt=auto?w=720&h=1280",
      message: "好吃的橙子",
      price: 2.0,
    },

    // url1: 'https://img1.baidu.com/it/u=4122344780,2704161739&fm=253&fmt=auto&app=138&f=JPEG?w=650&h=488',
    // message1: '好款的菊花',
    // price1: 10
  };
  // 渲染
  render() {
    const { item } = this.state;
    return (
      <div>
        <ProductInfo item={item}></ProductInfo>
        {/* <ProductInfo url={url1} message={message1} price={price1}></ProductInfo> */}
      </div>
    );
  }
}

// 不抛出相当于没写
export default App;
